package main

import (
	"fmt"
	"time"
)

func main() {
	ch := time.NewTicker(time.Second)
	i := 0
	for {
		t := <-ch.C
		i++
		fmt.Println("当前时间为:", t)
		if i > 5 {
			ch.Stop()
			break
		}
	}
}
